﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using Fly.Common.WorkFlow;
using RN.ERP.Entity.ZBDLRY;


namespace RN.ERP
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IBasicService”。
    [ServiceContract]
    public interface IBasicService
    {
        [OperationContract]
        string DoLoginWithAuthority(string userName, string password, string dogId, string groupType, string areaCode, string appId);

        [OperationContract]
        string DoLoginWithUGuid(string userGuid, string areaCode, string appId);

        /// <summary>
        /// 登录验证。
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="userType"></param>
        /// <returns></returns>
        [OperationContract]
        string DoLogin(string userName, string password, string userType, string areaCode, string systemid);

        [OperationContract]
        string GetUserInfo(string userguid, string areaCode);

        /// <summary>
        /// 根据key号获取用户信息，含用户是否主管
        /// </summary>
        /// <param name="dogid"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        [OperationContract]
        string GetUserInfobyDogID(int dogid, string areaCode);
        /// <summary>
        /// 通过企业组织机构代码获取企业信息
        /// </summary>
        /// <param name="OrginazationCode"></param>
        /// <returns></returns>
        [OperationContract]
        string GetCompanyInfo(string OrginazationCode, string areaCode);
        /// <summary>
        /// 重置组织机构代码
        /// </summary>
        /// <param name="userGuid"></param>
        /// <param name="newPwd"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        [OperationContract]
        bool ResetOrginazationCode(string userGuid, string newCode, string areaCode);

        [OperationContract]
        string DoLoginWithDog(string userName, string password, string dogId, string userType, string areaCode, string systemid);

        [OperationContract]
        string GetDictionaryTitleByCode(string code, string type, string areaCode);
        /// <summary>
        /// 重置密码
        /// </summary>
        /// <param name="userGuid"></param>
        /// <param name="newPwd"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        [OperationContract]
        bool ResetPassword(string userGuid, string newPwd, string areaCode);
        /// <summary>
        /// 根据类型查询字典集合。
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        [OperationContract]
        string GetDictionary(string type, string condition, string areaCode);

        [OperationContract]
        string BindDdlistArea(string areaInfo, string areaCode);


        /// <summary>
        /// 根据操作获取操作日志。
        /// </summary>
        /// <param name="objectId">操作对象编号。</param>
        /// <param name="functionType">操作类型。</param>
        /// <param name="startDate">起始时间。</param>
        /// <param name="endDate">截止时间。</param>
        /// <returns></returns>
        [OperationContract]
        string GetLogs(string objectId, string functionType, string startDate, string endDate, string areaCode);
        /// <summary>
        /// 获取变更项
        /// </summary>
        /// <param name="changeType"></param>
        /// <returns></returns>
        [OperationContract]
        string GetChangeItems(string changeType, string appId, string areaCode);

        [OperationContract]
        string GetBeforeChangeValue(string changeItem, string areaCode, params string[] parameters);

        [OperationContract]
        string GetBindChangeValue(string changeItem, string areaCode, params string[] parameters);

        [OperationContract]
        string AddChange(
            string changeSetInfo,
            string changeInfo,
            string changeType,
            string userGuid,
            string userRole,
            string userName, string areaCode);

        [OperationContract]
        string SubmitChange(
             string changeIds,
             string changeType,
             string userGuid,
             string userRole,
             string userName, string areaCode);

        [OperationContract]
        string EditChange(
           string changeSetInfo,
           string changeInfo,
           string changeType,
           string userGuid,
           string userRole,
           string userName, string areaCode);

        [OperationContract]
        string DeleteChange(
            string changeId,
            string changeType,
            string userGuid,
            string userRole,
            string userName, string areaCode);
        /// <summary>
        /// 变更审核
        /// </summary>
        [OperationContract]
        string AuditChange(string changeId, string flowCode, string description, bool isFinal, string userGuid, string userRole, string userName, string areaCode);

        [OperationContract]
        string GetChanges(string changeType, string corpUserGuid, string flowCode, string condition, int pageIndex, int pageSize, out int count, string areaCode);

        [OperationContract]
        string AuditLogs(string objectId, string areaCode);
        [OperationContract]
        string CheckChange(string changeSetId, string userRole, string areaCode);
        /// <summary>
        /// 返回变更项需要上传的图片
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string GetChangeItemUploadImg(string uploadID, string areaCode);
        #region 人员资格
        [OperationContract]
        List<DTO.tb_Emp_TitleType> GetPsnQualLevelByType(int nid, string areaCode);

        [OperationContract]
        List<DTO.a_Speciality> GetPsnspecialtyByQualLType(int nid, string areaCode);

        [OperationContract]
        string GetPersonQualityByGid(string qulaiguid, string areaCode);
        #endregion 人员资格

        #region 企业资质相关
        [OperationContract]
        List<DTO.KeyValue> GetCorpQualLevByUserGuid(int roleid, string areaCode);
        [OperationContract]
        List<DTO.CorpKindKeyAndValue> GetCorpQualTypesByUserGuid(int roleid, int classid, string areaCode);
        [OperationContract]
        string GetCorpQualByGuid(string guid, string areaCode);
        #endregion 企业资质相关

        [OperationContract]
        string GetQualitiesDic(string rootCode, string parentId);
        [OperationContract]
        string GetQualitiesDicAll(string rootCode, string parentId, string childRootCode);
        [OperationContract]
        string GetCity();
        [OperationContract]
        string GetQu(string code);
        [OperationContract]
        string GetAddress(string code);

        [OperationContract]
        string GetFuncPageMapping(string appId);

        [OperationContract]
        string GetNextFlowCode(string roleId,
           string manager,
           string areaCode,
           string classId,
           string flowCode,
           OptType optType);
        [OperationContract]
        string GetFlowCodeTitle(string areaCode, string classId, string flowCode);
        [OperationContract]
        string GetChangeDetails(string changeType, int changeSetId, string areaCode);

        #region 获取变更列表 2013-11-4 毛凯
        [OperationContract]
        string GetChangeRecords(string condition,
            int pageNum,
            int pageSize,
            string areaCode);
        [OperationContract]
        int GetChangeRecordsCount(string condition, string areaCode);
        #endregion
        [OperationContract]
        string GetSysStaticSettings(string rootCode, string areaCode);

        #region 根据用户角色获取所有流程状态
        [OperationContract]
        string GetAllFlowStatus(string areaCode, string roleId, string classId, out string msg);
        [OperationContract]
        string GetAllStatusFlowCodesByTitle(string roleID, string areaCode, string classId, out string msg);

        [OperationContract]
        string GetAllBusinessStatusAndProcessing(string roleID, string areaCode, string classId, out string msg, bool contiansAll = false);
        [OperationContract]
        string GetAllBusinessStatus(string areaCode, string classId, out string msg);

        [OperationContract]
        int CheckCreater(string areaCode, string classId, string roleID, out string msg);

        #endregion

        [OperationContract]
        bool IsAppRightValid(int AppID, Guid UserGuid, string areaCode);
        [OperationContract]
        string GetAreaCodeTitle(string areaCode);
        [OperationContract]
        string GetChangeEmpList(string conditions, int pageCount, int pageSize);
        [OperationContract]
        int GetChangeEmpCount(string conditions);

        #region 即时通讯

        [OperationContract]
        bool Send(DTO.T_Msg_SentMsg msg);

        [OperationContract]
        List<DTO.T_Msg_SentMsg> GetMsgs(string Receiver, string Sender, int AppID, DateTime? LastSearchTime
            , Boolean? IsRead, bool DoRead, string AreaCode);

        [OperationContract]
        string GetMsgUser(string areaCode, List<int> classIds, List<int> manageRoleIds);

        [OperationContract]
        bool MsgsDelete(string CurrentUser, int AppID, string msgIds);

        [OperationContract]
        bool SendChat(DTO.T_Chat_ChatInfo chatInfo);

        [OperationContract]
        List<DTO.T_Chat_ChatInfo> GetChatInfos(string Receiver, string Sender, int AppID, DateTime? LastSearchTime
            , Boolean? IsRead, bool DoRead, string AreaCode);

        [OperationContract]
        List<DTO.T_Chat_ChatInfo> GetChatHistory(string Receiver, string Sender, int AppID, DateTime? StartTime
            , DateTime? EndTime, string AreaCode);

        [OperationContract]
        List<DTO.T_Chat_ChatInfo> GetChatBrief(string Receiver, int MaxCount, int AppID);

        [OperationContract]
        List<DTO.T_Msg_SentMsg> GetLetterBrief(string Receiver, int MaxCount, int AppID);

        #endregion

        #region 获取系统配置
        [OperationContract]
        string GetApplicationConfig(string appId, string areaCode);
        #endregion

        [OperationContract]
        string GetSysDicts(string rootCode, string parentSID, string areaCode);

        [OperationContract]
        string DoExpertLogin(string idNum, string passWord, string appId, string areaCode);

        [OperationContract]
        string GetExpertDBList();

        [OperationContract]
        string GetExpertDBName(string code);

        [OperationContract]
        bool ResetPwdByTel(string phoneNum, string newPwd);

        #region 新变更方法

        [OperationContract]
        string GetChangeItemsNew(string changeType, int parentId, string appId, string areaCode);
        [OperationContract]
        string GetChangItemsValues(string changItemId, string objectId, string areaCode);
        [OperationContract]
        string GetChangeDetailsNew(int changeSetId, string areaCode);
        [OperationContract]
        string GetChangeItemsForIDNew(int changItemId, string areaCode);
        [OperationContract]
        string GetBeforeChangeValueNew(string changeItemId, string areaCode, params string[] parameters);
        [OperationContract]
        string GetBindChangeValueNew(string changeItemId, string areaCode, params string[] parameters);
        [OperationContract]
        string AddChangeNew(string changeSetInfo, string changeInfo, int codeType, string areaCode);
        [OperationContract]
        string EditChangeNew(string changeSetInfo, string changeInfo, string roleId, int codeType, string areaCode);
        [OperationContract]
        string SubmitChangeNew(string changeIds, string changeSetInfo, string changeInfo, string userGuid, string userName, string roleId, int codeType, string areaCode);

        #endregion

        [OperationContract]
        string GetChangeSetRecordList(out int cnt,
        int pageNo,
        int pageSize,
        string conditions,
        string areaCode);

        #region 获取条款
        [OperationContract]
        string GetEScoreType(int bKind, int bType, string Areacode, string condtion);

        [OperationContract]
        string Gete_ScoreTypeByTypeID(int typeid);

        [OperationContract]
        string GetEScore(int typeID, string condtion);

        [OperationContract]
        string GetEScoreByID(int ID);
        #endregion


        #region 烟台门户管理后台登录
        [OperationContract]
        string DoBackGroundLogin(string userName, string password, string areaCode);
        #endregion

        #region 老专家登陆
        [OperationContract]
        string CheckEmpInfo(string CerdentialsCode, string phone, string areaCode);
        #endregion
    }
}
